package com.seaboxdata.jt809.handle;

import com.seaboxdata.jt809.db.JT809Dao;
import com.seaboxdata.jt809.kafka.JT809Packet0x1402MessageProducer;
import com.seaboxdata.jt809.packet.JT809Packet0x1402;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ClassName JT809Packet0x1402Handle
 * @Description 车辆报警信息处理类，信息入库
 * @Author DFJX
 * @Date 2020/7/11 15:07
 * Version 1.0
 **/
public class JT809Packet0x1402Handle extends SimpleChannelInboundHandler<JT809Packet0x1402> {
    private static Logger log = LoggerFactory.getLogger(JT809Packet0x1402Handle.class);
    private JT809Packet0x1402MessageProducer producer=new JT809Packet0x1402MessageProducer();
    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, JT809Packet0x1402 jt809Packet0x1402) throws Exception {
        log.info("车辆报警信息：{}",jt809Packet0x1402.toString());
//        JT809Dao.insert0x1402(jt809Packet0x1402);

        producer.sendMessageToKafka(jt809Packet0x1402);
    }
}
